//
//  NearPublicInfoCell.m
//  Shengzhuli
//
//  Created by FXGuo on 2017/7/20.
//  Copyright © 2017年 kamangkeji. All rights reserved.
//

#import "NearPublicInfoCell.h"
#import <UIButton+WebCache.h>

@interface NearPublicInfoCell ()
@property (weak, nonatomic) IBOutlet UIButton *imageBtn;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *secondConH;

@property (weak, nonatomic) IBOutlet UITextField *timeField;
@property (weak, nonatomic) IBOutlet UITextField *nameField;
@property (weak, nonatomic) IBOutlet UITextField *addressField;

@end


@implementation NearPublicInfoCell

- (void)awakeFromNib {
    [super awakeFromNib];
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        self.secondConH.constant = ScreenW*125/309;
    });
}
- (IBAction)uploadClick:(UIButton *)btn
{
    if (self.uploadBtnClick) {
        self.uploadBtnClick(btn);
    }
}
- (IBAction)fieldTextChanged:(UITextField *)field
{
    if (field.tag == 0) {
        self.model.title = field.text;
    }else if (field.tag == 2) {
        self.model.address = field.text;
    }
}
- (IBAction)timeClick:(UIButton *)btn
{
    if (self.showTimeBlock) {
        self.showTimeBlock(self.timeField);
    }
}
- (void)setModel:(ActivityDetailModel *)model
{
    _model = model;
    [self.imageBtn sd_setImageWithURL:[NSURL URLWithString:model.activityPictureUrl] forState:UIControlStateNormal placeholderImage:GetImage(@"上传图片")];
    self.nameField.text = model.title;
    self.timeField.text = model.holdDate;
    self.addressField.text = model.address;
}



@end
